/*
 *    Copyright (c) 2018-2025, boss All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the boss developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: boss
 */

package com.hopes.bizz.basic.third.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hopes.bizz.basic.common.constant.enums.ParkBasicModDictEnum;
import com.hopes.bizz.basic.common.constant.enums.ParkBasicSysDictEnum;
import com.hopes.boss.admin.api.resolver.DictResolver;
import com.hopes.boss.admin.api.resolver.enums.AdminDictEnum;
import com.hopes.boss.common.entity.BaseLogicEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 第三方单位评价管理
 *
 * @author pig
 * @date 2023-11-16 10:22:12
 */
@Data
@TableName("base_third_evaluate")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "第三方单位评价管理")
public class BaseThirdEvaluateEntity extends BaseLogicEntity {

    private static final long serialVersionUID = 1L;


	/**
	* 标识
	*/
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description="标识")
    private Long id;

	/**
	* 机构ID
	*/
    @Schema(description="机构ID")
    private Long orgId;

	/**
	* 第三方单位
	*/
    @Schema(description="第三方单位")
	@NotNull(message = "第三方单位不能为空")
    private Long employerId;

	/**
	* 评估参与人
	*/
    @Schema(description="评估参与人")
	@NotBlank(message = "评估参与人不能为空")
    private String evaluatePerson;

	/**
	* 下次评估日期
	*/
    @Schema(description="下次评估日期")
	@JsonFormat(pattern = "yyyy-MM-dd")
    private Date evaluateNextDate;

	/**
	* 评估日期
	*/
    @Schema(description="评估日期")
	@JsonFormat(pattern = "yyyy-MM-dd")
    private Date evaluateDate;

	/**
	* 评估结果
	*/
    @Schema(description="评估结果")
	@NotBlank(message = "评估结果不能为空")
    private String evaluateResult;

	/**
	* 备注说明
	*/
    @Schema(description="备注说明")
    private String remark;

	/**
	* 附件
	*/
    @Schema(description="附件")
    private String attachment;

	public String getEmployerIdStr() {
		return DictResolver.getItemLabelByValue(ParkBasicModDictEnum.third_unit, this.employerId);
	}
	public String getEvaluateResultStr() {
		return DictResolver.getItemLabelByValue(ParkBasicSysDictEnum.assess_result, this.evaluateResult);
	}


	public String getOrgIdStr() {
		return DictResolver.getItemLabelByValue(AdminDictEnum.sys_company, this.orgId);
	}
}
